package beerAgent;

import evolutionaryLoop.EvolutionaryParameters;
import evolutionaryProblems.Phenotype;
import gui.GUIFrame;
import gui.GameModel;

public class BeerGameModel extends GameModel<RunBeerPhenotype> {

	// private RunBeerPhenotype runPhenotype;
	private BeerParameters parameters;

	public BeerGameModel(GUIFrame guiFrame, BeerParameters parameters) {
		super(guiFrame);
		this.parameters = parameters;
	}

	@Override
	protected void runPhenotype(Phenotype phenotype) {
		reset();
		RunBeerSettingPanel settingPanel = (RunBeerSettingPanel) this.runSettingPanel;
		settingPanel.setPhenotype((BeerPhenotype) phenotype);
		runPhenotype = new RunBeerPhenotype(this, (BeerPhenotype) phenotype);
		new Thread(runPhenotype).start();
	}

	@Override
	public int getIterationsPerMap() {
		return parameters.getIterations();
	}

	@Override
	protected void initRunPanel() {
		runSettingPanel = new RunBeerSettingPanel(this);
		gamePanel.setGameSettingsPanel(runSettingPanel);
	}

//	@Override
//	public void addPheontype(Phenotype phenotype, int generation) {
//		super.addPheontype(phenotype, generation); 
//	}
	
	public EvolutionaryParameters getParameters() {
		return parameters;
	}


}
